<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>创建外单位记录</title> 
<%@ include file="/common/include.jsp" %>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/My97DatePicker/WdatePicker.js"></script>
<script>
$(document).ready(function() {
	var status = "${status}";
	if(status.length>0){
		if(status=="1")
		{
			alert("创建成功!");
		}else{
			alert("创建失败!");
		}
		window.location.href="${pageContext.request.contextPath}/page/departmentList.jsp";
	}
});

function materialcreatesubmit() {
	var isValidatestate = true;
	var type_mask = '0';
	var cd_mask = '';
	var page = '1';
	var rows = '15';
	var r = /^[1-9]*[0-9][0-9]*$/; //正整数
	var t = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)([\w-]+\.)+(\S)+$/i;
	var te = /^([\w-]+\.)+(\S)+$/i;
	var a = /select|insert|update|dalete|\'|\/\*|\.\.\/|union|into|load_file|outfile/;
	var name = $.trim($("#s_id").val()); //获取广告位名称
	var txt_len = $.trim(name).length;
	
	name = $("#name").val();
	if(name ==''){
		$("#uname").show();
		$("#uname").html('外单位名称不能为空');
		return false;
	}
	$("#uname").hide();
	
	
	document.getElementById("form").submit();
}

function comeback() {
	window.location="${pageContext.request.contextPath}/page/departmentList.jsp";
}
</script>
</head>

<body>
<div class="wrapper">
	<jsp:include page="/common/header.jsp"><jsp:param value="2" name="nav"/></jsp:include>
	<div class="content" style="">
		<div class="col_l">
			<div class="l_top"></div>
			<div class="l_menu">
			      <jsp:include page="/common/l_info_place.jsp"><jsp:param value="4" name="nav"/></jsp:include>
			</div>
			<div class="l_bottom"></div>
		</div>
		<div class="col_r" style="">
			<div class="guide blue">
				<span class="left">当前位置：<a href="${pageContext.request.contextPath }/page/departmentList.jsp">外单位管理</a> 增加</span>
			</div>
			<div class="mx_title">
				<div class="cj_l"></div>
				<div class="cj_c"> 增加</div>
				<div class="cj_r"></div>
			</div>                
			<form id="form" name="form" action="${pageContext.request.contextPath }/department/add" method="post">				 
				<div class="cj_con" id="main" style="">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr style="" id='trmaterialname'>
							<td width="14%" height="35" align="right">外单位名称：</td>
                            <td width="2%" align="center"><div class="star">*</div></td>
                            <td width="84%">
                            	<input type="text" id='name' name="name" size="35"  value=''class="input_cj left" />                 
                            	<div class="tips_error left" style="display:none;"  id='uname'></div>
                             </td>
						</tr>
						<tr>
							<td height="35" align="right">地址：</td>
							
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="address" name="address" /></span>
								<div style="display:none;" class="tips_error left" id="tp_address"></div>
							</td>
						</tr>
						<tr>
								<td height="35" align="right">主管人：</td>
								
								<td colspan="2">
								<span class="left">
								<input type="text"  size="5" class="input_cj" id="principal" name="principal" /></span>
								<div style="display:none;" class="tips_error left" id="tp_principal"></div>
								</td>
							</tr>
						
					</table>
					<div style=" margin-left:120px; margin-top:10px;">
						<a href="javascript:void(0)" id='onsubmit'>
							<img onclick="materialcreatesubmit();" src="${pageContext.request.contextPath}/images/over.gif" />
					  	</a>
					    <img onclick='comeback();'src='${pageContext.request.contextPath}/images/formcacle.gif' style="margin-left:15px;cursor:pointer"/>
					</div>
				</div>
			</form> 
		</div>
		 
		   <div class="clear"></div>
		   
	  </div>

<div class=footer>CopyRight &copy;Research Institute of Computer Systems of SCUT. All Rights Reserved
	</div>
</div>
<script>
function showHelp(obj){
var help = document.getElementById("key"+obj).style.display;
document.getElementById("key"+obj).style.display="";

} 

function closeHelp(obj){
var help = document.getElementById("key"+obj).style.display;
document.getElementById("key"+obj).style.display="none";
}
	</script>
</body>
</html>